<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<style type="text/css" media="screen">
		#box{
			width: 100px;
			height: 100px;
			background-color: red;
			opacity: .5;
		}
	</style>
</head>
<body>
	<div id="box" style="font-size:12px;"></div>
	<script type="text/javascript" src="css.js"></script>
	<script type="text/javascript">


		var oBox = document.getElementById('box');
		css(oBox,'rotateX',10);
		css(oBox,'rotateY',10);
		css(oBox,'scaleX',1);
		css(oBox,'translateX',1);
		tap(oBox,function(){
			console.log(css(oBox,'scaleX'))
		});





		function tap(el,fn){
			var startPoint = {};
			el.addEventListener('touchstart', function(e) {
				startPoint = {
					x: e.changedTouches[0].pageX,
					y: e.changedTouches[0].pageY
				}
			});
			el.addEventListener('touchend', function(e) {
				var nowPoint = {
					x: e.changedTouches[0].pageX,
					y: e.changedTouches[0].pageY
				}
				if(Math.abs(nowPoint.x - startPoint.x) < 5
				&&Math.abs(nowPoint.y - startPoint.y) < 5){
					fn&&fn.call(el,e);
				}
			});
		}
	</script>
</body>
</html>
